const fs = require('fs');

// fs.readFile(__dirname + '/01-实力对象与函数对象.html',(err,data)=>{
//     if(err) throw err;
//     console.log(data.toString());
// })

let p = new Promise((resolve, reject)=>{
    fs.readFile(__dirname + '/01-实力对象与函数对象.html',(err,data)=>{
        if(err){
            reject(err.message);
        }else{
            resolve(data.toString());
        }
    })
})

p.then(value=>{
    console.log(value);
},reason=>{
    console.log(reason);
})